
/*** Position Class - a 2D point of position ***/

public class Position{
	
	public int x;
	public int y;
	
	//default constructor - sets to 0
	public Position() { 
		x = 0;
		y = 0;
	}
	
	//constructor - sets x,y position
	public Position(int x, int y) {
		set(x,y);
	}
	
	//set position
	public void set(int x , int y){
		this.x = x;
		this.y = y;
	}
	
	public void set(Position p){
		this.x = p.x;
		this.y = p.y;
	}
	
	//function returns string representing position
	public String toString(){
		return (x + "," + y);
	}
	
	//returns true if received position is the same as this one
	public boolean isSame(Position p){
		if (x == p.x && y == p.y )
			return true;
		else
			return false;
	}

}
